Optimal. Leaf size=103 \[ \frac {2 \sqrt {a} \sqrt {g} \tan ^{-1}\left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{c f}+\frac {2 \sec (e+f x) \sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}{c f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.31, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3007, 2854,
211, 3009, 12, 30} \begin {gather*} \frac {2 \sqrt {a} \sqrt {g} \text {ArcTan}\left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a} \sqrt {g \sin (e+f x)}}\right )}{c f}+\frac {2 \sec (e+f x) \sqrt {a \sin (e+f x)+a} \sqrt {g \sin (e+f x)}}{c f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 30
Rule 211
Rule 2854
Rule 3007
Rule 3009
Rubi steps
\begin {align*} \int \frac {\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}{c-c \sin (e+f x)} \, dx &=g \int \frac {\sqrt {a+a \sin (e+f x)}}{\sqrt {g \sin (e+f x)} (c-c \sin (e+f x))} \, dx-\frac {g \int \frac {\sqrt {a+a \sin (e+f x)}}{\sqrt {g \sin (e+f x)}} \, dx}{c}\\ &=-\frac {(2 a g) \text {Subst}\left (\int \frac {1}{c g x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{f}+\frac {(2 a g) \text {Subst}\left (\int \frac {1}{a+g x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{c f}\\ &=\frac {2 \sqrt {a} \sqrt {g} \tan ^{-1}\left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{c f}-\frac {(2 a) \text {Subst}\left (\int \frac {1}{x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{c f}\\ &=\frac {2 \sqrt {a} \sqrt {g} \tan ^{-1}\left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{c f}+\frac {2 \sec (e+f x) \sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}{c f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.63, size = 194, normalized size = 1.88 \begin {gather*} \frac {2 e^{i (e+f x)} \left (2 \left (-1+e^{2 i (e+f x)}\right )-i \left (-i+e^{i (e+f x)}\right ) \sqrt {-1+e^{2 i (e+f x)}} \tan ^{-1}\left (\sqrt {-1+e^{2 i (e+f x)}}\right )-\left (-i+e^{i (e+f x)}\right ) \sqrt {-1+e^{2 i (e+f x)}} \tanh ^{-1}\left (\frac {e^{i (e+f x)}}{\sqrt {-1+e^{2 i (e+f x)}}}\right )\right ) \sqrt {g \sin (e+f x)} \sqrt {a (1+\sin (e+f x))}}{c \left (-1+e^{4 i (e+f x)}\right ) f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(913\) vs.
\(2(87)=174\).
time = 28.70, size = 914, normalized size = 8.87
method | result | size |
default | \(\frac {\left (4 \sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\sin \left (f x +e \right ) \ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\sin \left (f x +e \right )-\cos \left (f x +e \right )+1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\sin \left (f x +e \right )+\cos \left (f x +e \right )-1}\right )-4 \sin \left (f x +e \right ) \arctan \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}+1\right )-4 \sin \left (f x +e \right ) \arctan \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}-1\right )-\sin \left (f x +e \right ) \ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\sin \left (f x +e \right )+\cos \left (f x +e \right )-1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\sin \left (f x +e \right )-\cos \left (f x +e \right )+1}\right )-\cos \left (f x +e \right ) \ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\sin \left (f x +e \right )-\cos \left (f x +e \right )+1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\sin \left (f x +e \right )+\cos \left (f x +e \right )-1}\right )-4 \cos \left (f x +e \right ) \arctan \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}+1\right )-4 \cos \left (f x +e \right ) \arctan \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}-1\right )-\cos \left (f x +e \right ) \ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\sin \left (f x +e \right )+\cos \left (f x +e \right )-1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\sin \left (f x +e \right )-\cos \left (f x +e \right )+1}\right )+\ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\sin \left (f x +e \right )-\cos \left (f x +e \right )+1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\sin \left (f x +e \right )+\cos \left (f x +e \right )-1}\right )+4 \arctan \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}+1\right )+4 \arctan \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}-1\right )+\ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\sin \left (f x +e \right )+\cos \left (f x +e \right )-1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\sin \left (f x +e \right )-\cos \left (f x +e \right )+1}\right )\right ) \sqrt {g \sin \left (f x +e \right )}\, \sqrt {a \left (1+\sin \left (f x +e \right )\right )}\, \sqrt {2}}{4 c f \sin \left (f x +e \right ) \cos \left (f x +e \right ) \sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}}\) | \(914\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.53, size = 480, normalized size = 4.66 \begin {gather*} \left [\frac {\sqrt {-a g} \cos \left (f x + e\right ) \log \left (\frac {128 \, a g \cos \left (f x + e\right )^{5} - 128 \, a g \cos \left (f x + e\right )^{4} - 416 \, a g \cos \left (f x + e\right )^{3} + 128 \, a g \cos \left (f x + e\right )^{2} + 289 \, a g \cos \left (f x + e\right ) + 8 \, {\left (16 \, \cos \left (f x + e\right )^{4} - 24 \, \cos \left (f x + e\right )^{3} - 66 \, \cos \left (f x + e\right )^{2} + {\left (16 \, \cos \left (f x + e\right )^{3} + 40 \, \cos \left (f x + e\right )^{2} - 26 \, \cos \left (f x + e\right ) - 51\right )} \sin \left (f x + e\right ) + 25 \, \cos \left (f x + e\right ) + 51\right )} \sqrt {-a g} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )} + a g + {\left (128 \, a g \cos \left (f x + e\right )^{4} + 256 \, a g \cos \left (f x + e\right )^{3} - 160 \, a g \cos \left (f x + e\right )^{2} - 288 \, a g \cos \left (f x + e\right ) + a g\right )} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + \sin \left (f x + e\right ) + 1}\right ) + 8 \, \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )}}{4 \, c f \cos \left (f x + e\right )}, -\frac {\sqrt {a g} \arctan \left (\frac {\sqrt {a g} {\left (8 \, \cos \left (f x + e\right )^{2} + 8 \, \sin \left (f x + e\right ) - 9\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )}}{4 \, {\left (2 \, a g \cos \left (f x + e\right )^{3} + a g \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 2 \, a g \cos \left (f x + e\right )\right )}}\right ) \cos \left (f x + e\right ) - 4 \, \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )}}{2 \, c f \cos \left (f x + e\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {\sqrt {g \sin {\left (e + f x \right )}} \sqrt {a \sin {\left (e + f x \right )} + a}}{\sin {\left (e + f x \right )} - 1}\, dx}{c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sqrt {g\,\sin \left (e+f\,x\right )}\,\sqrt {a+a\,\sin \left (e+f\,x\right )}}{c-c\,\sin \left (e+f\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________